<template>
	<view class="header">
			<uni-icons type="left" size="24" color="#fff" @click="backClick"></uni-icons>
			<text class="header__title">{{navTitle}}</text>
			<image src="@/static/icons/cash_history.png" mode="widthFix" class="header__icon" @click="recordClick"></image>
		</view>
</template>

<script>
	export default{
		data(){
			return {}
		},
		props:{
			navTitle:{
				type:String,
				default:""
			}
		},
		methods:{
			backClick(){
				let canNavBack = getCurrentPages()
				if( canNavBack && canNavBack.length>1) {  
					uni.navigateBack() 
				} else {  
				    history.back();  
				}
			}
		}
	}
</script>

<style lang="scss">
	.header{
		width: 750rpx;
		padding: 0 30rpx;
		box-sizing: border-box;
		height: 128rpx;
		@include flexRowAlign(space-between);
		.header__title{
			flex: 1;
			font-size: 46rpx;
			font-weight: 800;
			color: #FFFFFF;
			text-align: center;
		}
		.header__icon{
			width: 42rpx;
			height: 42rpx;
		}
	}
</style>